{include file="public/header" /}


<div class="page">
    <div class="fixed-bar">
        <div class="item-title">
            <div class="subject">
                <h3>{$Think.lang.tasting_index}</h3>
                <h5></h5>
            </div>
            {include file="public/admin_items" /}
        </div>
    </div>
    <form action="/index.php/admin/tasting/addUserExcel.html" method="post" enctype="multipart/form-data">
        <div class="ds-search-form" style="margin-top: 10px;height: 25px;">
            <dl>
                <dt style="color: red;font-weight: bold;line-height: 10px;margin-top: -10px;">上传会员excel表(仅支持*.csv格式),<a style="text-decoration:underline;" href="https://img.zhongjiupei.com/excel_eg.jpg" target="_blank">点击查看excel格式</a></dt>
                <dd style="margin-top: 15px">
                    <input type="file" name="user_excel">
                </dd>
            </dl>
            <div class="btn_group">
                <input type="hidden" value="{$Think.get.id}" name="tasting_id">
                <dd><input type="submit" class="btn" value="确认导入"></dd>
            </div>
        </div>
    </form>
    <form action="/index.php/admin/tasting/add_user.html" method="post" enctype="multipart/form-data">
        <div class="ds-search-form" style="margin-top: 10px;height: 50px;">
            <dl>
                <dt style="color: red;font-weight: bold;line-height: 8px;margin-top: -10px;">多个会员手机号,请以 , 隔开,若手机号已有品鉴卡,则不能再生成品鉴卡</dt>
                <dd style="margin-top: 15px">
                    <input type="text" name="phone"placeholder="请输入手机号">
                </dd>
            </dl>
            <div class="btn_group">
                <input type="hidden" value="{$Think.get.id}" name="tasting_id">
                <dd><input type="submit" class="btn" value="确认添加"></dd>
            </div>
        </div>
    </form>
    <form method="get" name="formSearch">
        <div class="ds-search-form">
            <dl>
                <dt>{$Think.lang.tasting_code}</dt>
                <dd><input type="text" name="code" id="code" class="txt" value='{$Request.get.code}'></dd>
                <dd>
                    <select name="tasting_status">
                        <option value="">{$Think.lang.tasting_status}</option>
                        <option value="0" {eq name="Request.get.tasting_status" value="0"}selected=selected{/eq}>{$Think.lang.tasting_status_0}</option>
                        <option value="1" {eq name="Request.get.tasting_status" value="1"}selected=selected{/eq}>{$Think.lang.tasting_status_1}</option>
                        <option value="2" {eq name="Request.get.tasting_status" value="2"}selected=selected{/eq}>{$Think.lang.tasting_status_2}</option>
                    </select>
                </dd>
                <dd>
                    <select name="member_status">
                        <option value="">是否绑定</option>
                        <option value="1" {eq name="Request.get.member_status" value="1"}selected=selected{/eq}>是</option>
                        <option value="2" {eq name="Request.get.member_status" value="2"}selected=selected{/eq}>否</option>
                    </select>
                </dd>
            </dl>
            <dl>
                <dt>{$Think.lang.tasting_phone}</dt>
                <dd>
                    <input type="text" name="member_name" id="member_name" class="txt" value='{$Request.get.member_name}'>
                </dd>
            </dl>
            <div class="btn_group">
                <input type="hidden" value="{$Think.get.id}" name="id">
                <a href="javascript:document.formSearch.submit();" class="btn " title="{$Think.lang.ds_query}">{$Think.lang.ds_query}</a>
                <a href="javascript:dsLayerOpen('{:url('Tasting/tasting_code','tasting_id='.$Think.get.id)}','生成品鉴码')" class="btn">生成品鉴码</a>
                <a class="btn btn-mini" href="javascript:export_xls('{:url('Tasting/export_step1','tasting_id='.$Think.get.id)}')"><span>导出Excel</span></a>
            </div>
        </div>
    </form>
    <table class="ds-default-table">
        <thead>
        <tr class="thead">
            <th class="w270">id</th>
            <th class="w150 align-center">{$Think.lang.tasting_phone}</th>
            <th class="w150 align-center">{$Think.lang.tasting_status}</th>
            <th class="w150 align-center">{$Think.lang.tasting_code}</th>
        </tr>
        </thead>
        <tbody id="treet1">
        {notempty name="memberList"}
        {foreach name="memberList" item="v"}
        <tr class="hover edit row" >
            <td class="align-center">{$v.ts_member_id}</td>
            <td class="align-center">{$v.member_name}</td>
            <td class="align-center">{$v.status}</td>
            <td class="align-center">{$v.code}</td>
        </tr>
        {/foreach}
        {else /}
        <tr class="no_data">
            <td colspan="10">{$Think.lang.ds_no_record}</td>
        </tr>
        {/notempty}
        </tbody>
    </table>
    {$show_page}
</div>

<link rel="stylesheet" type="text/css" href="https://www.layuicdn.com/layui-v2.5.5/css/layui.css" />
<script src="https://www.layuicdn.com/layui-v2.5.5/layui.js"></script>
<!--页面JS控制脚本-->
<script type="text/javascript">
    layui.use(['form','laydate'],function(){
        var form = layui.form;
        var laydate = layui.laydate;
        //日期
        laydate.render({
            elem: '#start_date'
        });
        laydate.render({
            elem: '#end_date'
        });
    });
</script>